<script>
  //Add By RenQingBin 2022-01-16
</script>

<template>
  <van-row
    class="recommend_item"
    type="flex"
    justify="space-between"
    align="center"
    gutter="4"
    @click="handleClick(item)"
  >
    <van-col span="2"></van-col>
    <van-col span="20">
      <!--  层层嵌套   -->
      <van-row type="flex" justify="start" align="center" style="text-align: left">

        <!--<div style="display: flex;margin-bottom: 10px;">
          <van-image
            style="margin: 10px 10px 0 0;"
            round
            cover
            width="1.3rem"
            height="1.3rem"
            :src="item.avatar ? item.avatar : logoImg"
          />-->

          <!--<div style="width: 240px;font-weight: 600;color: #828282;">
            <div style="margin-top: 10px">{{ '近聘昵称：' + (item.nick_name ? item.nick_name : '暂无') }}</div>
            <div style="margin-top: 10px">{{ '近聘账号：' + (item.ids ? item.ids : '暂无') }}</div>
            <div style="display: flex">
              <div
                style="margin-top: 10px; margin-right: 10px"
              >{{ '手机号：' + (item.mobile ? item.mobile : '暂无') }}</div>

              <van-button
                size="mini"
                type="info"
                plain
                round
                @click.stop="call(item.mobile)"
                style="padding: 0 8px;flex-shrink: 0;"
              >电话联系</van-button>
            </div>
          </div>-->
        <!--</div>-->

        <van-col span="12">

          <div style="margin-top: 10px">{{ '申请借支金额：' + item.money + ' 元' }}</div>
          <div style="margin-top: 10px">{{ '部门：' + item.sector }}</div>
          <div style="margin-top: 10px">{{ '您的姓名：' + item.name }}</div>
          <div style="margin-top: 10px">{{ '您的工号：' + item.jobid }}</div>
          <div style="margin-top: 10px">{{ '身份证号：' + item.identityid }}</div>
          <div style="margin-top: 10px">{{ '手机号：' + item.tel }}</div>

          <!--<div>
    工作状态：
    <van-tag :type="needStatus">{{ item.job_status ? statusName[item.job_status] : '未知' }}</van-tag>
  </div>

  <div style="margin-top: 10px">{{ '工作时长：' + (item.jobtime ? item.jobtime : '暂无') }}</div>
  <div style="margin-top: 10px">{{ '工作类型：' + (item.job_category_id ? item.job_category_id : '暂无') }}</div>

  <div style="margin-top: 10px">{{ '上家服务费：' + (item.last_cost ? '￥' + item.last_cost : '暂无') }}</div>
  <div style="margin-top: 10px">{{ '平台服务费：' + (item.platform_cost ? '￥' + item.platform_cost : '暂无') }}</div>-->
        </van-col>

        <!--<van-col span="12">
          <div
            style="margin-top: 10px"
          >{{ '代招类型：' + (item.generation_of_commission ? item.generation_of_commission : '暂无') }}</div>
          <div
            style="margin-top: 13px"
          >{{ '代招费：' + (item.dzftotalmny ? '￥' + item.dzftotalmny : '暂无') }}</div>
          <div
            style="margin-top: 10px"
          >{{ '代招费到账：' + (item.accounting_cost ? '￥' + item.accounting_cost : '暂无') }}</div>
           <div
            style="margin-top: 10px"
          >{{ '下家服务费：' + (item.former_service_fee ? '￥' + item.former_service_fee : '暂无') }}</div>
           <div
            style="margin-top: 10px"
          >{{ '下家服务费到账：' + (item.former_service_fee ? '￥' + item.former_service_fee : '暂无') }}</div>
          <div
            style="margin-top: 10px"
            v-if="item.company_id"
          >{{ '企业提成到账：' + (item.arrivemny ? '￥' + item.arrivemny : '暂无') }}</div>
        </van-col>-->
      </van-row>


      <!--<van-row
        v-if="item.company_id"
        type="flex"
        justify="start"
        align="center"
        style="text-align: left; margin-top: 10px"
      >
        <van-col span="12">
          <div>企业提成：{{ item.totalmny ? item.totalmny : '暂无' }}</div>
        </van-col>
        <van-col span="12">
          <div style="position: relative;">
            <span>企业资料：</span>
            <van-button
              size="mini"
              type="info"
              plain
              round
              @click.stop="toEnterpriseDetailPage(item.company_id)"
              style="padding: 0 8px;position: absolute;top: -6px;"
            >点击查看</van-button>
          </div>
        </van-col>
      </van-row>-->

      <!--<div
        style="margin-top: 10px; text-align: left"
      >{{ '注册时间：' + (item.registertime ? item.registertime : '未知') }}</div>
      <div
        style="margin-top: 10px; text-align: left"
        v-show="$route.path === '/recommend_person_Detail'"
      >{{ '结算时间：' + (item.time ? item.time : '暂无') }}</div>-->


    </van-col>
  </van-row>
</template>

<script>
import {Dialog} from 'vant'
import logoImg from '@/assets/logo.png'
export default {
  name: 'comAdvanceList',
  props: {
    item: Object,
    routeName: String
  },
  data() {
    return {
      logoImg,
      statusName: {
        Leave: '自离',
        Resign: '辞职',
        OnJob: '在职'
      }
    }
  },

  computed: {
    needStatus() {
      switch (this.item.work_status) {
        case '在职':
          return 'success'
        case '离职':
          return 'danger'
        default:
          return 'warning'
      }
    }
  },
  created() {
  },
  methods: {
    handleClick(item) {
      if (this.routeName != 'recommend_personDetail') {
        this.$router.push({
          path: `/recommend_person_Detail/${item.id}`
        })
      }
    },

    toEnterpriseDetailPage(id) {
      this.$router.push({
        path: `/enterpriseDetail/${id}`
      })
      // todo 以后使用
      /*if(id && this.item.isEnterpriseUser){
          this.$router.push({
            path: `/enterpriseDetail/${id}`
          })
        } else {
          Dialog.alert({
            title: '抱歉！',
            message: '您不是企业用户，无法查看。',
            theme: 'round-button',
            messageAlign: 'left',
          }).then(() => {
            // on close
          });
        }*/
    },
    call(mobile) {
      if (mobile) window.location.href = 'tel:' + mobile
    }
  }
}
</script>

<style scoped lang="css">
.recommend_item {
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
  line-height: 1.1em;
  padding: 16px 0 12px 0;
}
</style>
